<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/30 0030
 * Time: 19:27
 */

namespace api\storage\model;


use think\Model;

class FeedStationModel extends Model
{
    protected $table = 'smt_feed_station';
    protected $pk = 'uuid';

    /****
     * @param $where
     * @return array|false|\PDOStatement|string|Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\Exception
     * 返回工单当前的状态
     */
    public function checkStatus($where){
        $result = $this->where($where)
            ->field('feed_id,status')
            ->find();
        return $result;
    }

    public function updateFeed($where,$update){
        $result =  $this->where($where)
                    ->update($update);
        return $result;
    }

    /***
     * @param $where
     * @param $field
     * @return array|false|\PDOStatement|string|Model
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     * @throws \think\Exception
     * 根据条件和field返回一条feed数据
     */
    public function findFeed($where,$field = '*'){
        $result = $this->where($where)
            ->field($field)
            ->find();
        return $result;
    }


}